/*
 * Copyright 2002-2019 Intel Corporation.
 * 
 * This software is provided to you as Sample Source Code as defined in the accompanying
 * End User License Agreement for the Intel(R) Software Development Products ("Agreement")
 * section 1.L.
 * 
 * This software and the related documents are provided as is, with no express or implied
 * warranties, other than those that are expressly stated in the License.
 */

#ifndef _CONTROLLER_EVENTS_H_
#define _CONTROLLER_EVENTS_H_

#include <string>
#include <map>
#include "pin.H"

using namespace std;


namespace CONTROLLER
{

typedef enum{
        EVENT_INVALID = 0,
        EVENT_PRECOND,
        EVENT_START,
        EVENT_STOP,
        EVENT_THREADID,
        EVENT_WARMUP_START,
        EVENT_WARMUP_STOP,
        EVENT_PROLOG_START,
        EVENT_PROLOG_STOP,
        EVENT_EPILOG_START,
        EVENT_EPILOG_STOP,
        EVENT_STATS_RESET,
        EVENT_STATS_EMIT,
        EVENT_STATS_EMIT_RESET,
        EVENT_USER_0,
        EVENT_USER_1,
        EVENT_USER_2,
        EVENT_USER_3,
        EVENT_USER_4,
        EVENT_USER_5,
        EVENT_USER_6,
        EVENT_USER_7,
        EVENT_USER_8,
        EVENT_USER_9
    }EVENT_TYPE;

//the events manager can be created only by the control object
class CONTROLLER_EVENTS
{
public:
    EVENT_TYPE AddEvent(const string& event_name);
    string IDToString(EVENT_TYPE ev);
    EVENT_TYPE EventStringToType(const string& event_name);
    
    
private:
    friend class CONTROL_MANAGER;
    CONTROLLER_EVENTS();     
    map<string,EVENT_TYPE> _events;
    static const EVENT_TYPE _max_user_ev = EVENT_USER_9;
    
    
    
};//class
}//namespace
#endif
